<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // console.log(Math.max( [ 35,67,46,75,38 ] ));
  // console.log(Math.max( 35,67,46,75,38 ));

  // 数组的最大值

  // var arr = [ 35,67,46,75,38 ];
  // console.log( Math.max.apply(Math, arr) );
  // console.log( Math.min.apply(Math, arr) );


  
  // 万能检测：借助this配合toString方法检测数据类型
  // xx.toString()

  var obj = {};

  console.log( obj.toString.call( "hello" ) );
  console.log( obj.toString.call( 123 ) );
  console.log( obj.toString.call( true ) );
  console.log( obj.toString.call( [] ) );
  console.log( obj.toString.call( function(){} ) );
  console.log( obj.toString.call( undefined ) );
  console.log( obj.toString.call( null ) );
  console.log( obj.toString.call( new Date() ) );

  

  // 继承

  var obj1 = {
    name: "obj1",
    show: function(){
      console.log(this.name);
    }
  }

  var obj2 = {
    name:"obj2"
  }
  
  obj1.show();

  obj1.show.call(obj2);



  // 面向对象编程




</script>
</html>